import { createSlice } from '@reduxjs/toolkit'

const initialState = {
   token:'',
   username:''
}

export const citySlice = createSlice({
  name: 'city',
  initialState,
  reducers: {
    Tookle(state,action){
      state.token=action.payload
      console.log(action.payload);
    },
       User(state,action){
      state.username=action.payload
      console.log(action.payload);
    }
  },
})

// Action creators are generated for each case reducer function
export const {Tookle,User} = citySlice.actions

export default citySlice.reducer